<template>
  <view class="login">
    <view class="box">
        <phoneLogin v-if="ind === 0"/>
        <emailLogin v-else-if="ind === 1"/>
        <QRcodeLogin v-else/>
        <view class="loginBlock">
            <button class="loginBtn">登录</button>
            <view class="loginMethod">
                <view v-for="item in loginList" :key="item.id" @click="ind = item.id">{{ item.name }}登录</view>
            </view>
        </view>
    </view>
  </view>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import phoneLogin from './components/phoneLogin.vue'
import emailLogin from './components/emailLogin.vue'
import QRcodeLogin from './components/QRcodeLogin.vue'

const ind = ref<number>(0)

interface loginList {
    name: string
    id: number
}
const loginList = ref<loginList[]>([
    {name : '手机号' , id : 0},
    {name : '邮箱' , id : 1},
    {name : '二维码' , id : 2}
])
</script>

<style scoped lang="scss">
.login {
    width: 100vw;
}
.box{
    padding: 10px;
}
.loginBlock{
    margin-top: 10px;
}
.loginBtn{
    width: 100%;
    height: 40px;
    background: #C84341;
    color: #fff;
    text-align: center;
    line-height: 40px;
}
.loginMethod{
    padding: 0 70px;
    font-size: 12px;
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
}
</style>